import React, { Component } from 'react';
import jssdk from '../../utils/jsbridge-sdk';

export default class LxList extends Component {
  constructor(props) {
    super(props);

    this.handleChildClick = this.handleChildClick.bind(this);
  }


  handleChildClick() {
    if (jssdk.getVersion){
      jssdk.getVersion();
    }
  }

  render() {
    let books = this.props.books || [];
    return (
      <div>
        <button className="btn" onClick={this.handleChildClick} style={{marginTop: 20}}>子组件</button>
        {
          books.map((item) => (<div key={item.bookName}>
            书名：{item.bookName}
            单价{item.price}
            出版社：{item.address}
          </div>))
        }
      </div>
    )
  }
}